﻿<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
request.setCharacterEncoding("UTF-8");
String htmlData = request.getParameter("content1") != null ? request.getParameter("content1") : "";
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<link rel="shortcut icon" href="image/favicons.ico" type="image/x-icon" />
<link rel="stylesheet" href="<%=basePath%>common/default/default.css" />
	<link rel="stylesheet" href="<%=basePath%>common/plugins/code/prettify.css" />
	<script charset="utf-8" src="<%=basePath%>common/lang/kindeditor.js"></script>
	<script charset="utf-8" src="<%=basePath%>common/lang/zh_CN.js"></script>
	<script charset="utf-8" src="<%=basePath%>common/plugins/code/prettify.js"></script>
        <!-- Main content -->
        <section class="content" id="refundcontent">
          <div class="row">
            <div class="col-md-12">
			
              <div class="box box-danger">
                <div class="box-header">
                  
                  <section class="content-header">
			<h1>
			<ol class="breadcrumb">
				<li><a href="<%=basePath%>admin/gonggao"><i class="fa fa-th-list fa-lg"></i>列表</a></li>
				<li>添加公告</li>
			</ol>
          </h1>

		  
        </section>
                </div>
                <div class="box-body">
                  <!-- phone mask -->
                  <div class="form-group">
               
					<div class="bg-info" style="padding:10px;">		
						<p>
							<form name="example" method="post" action="addgg" accept-charset="UTF-8"onsubmit="document.charset='utf-8'; return ischeckNum()">
								标题：
								<input style="margin-right: 80px;" type="text" name="title"
									value="" id="title" />
								<input type="hidden" name="time" value="">
								<br>
								类别：
								<select name="type">
									<option value="社会招聘" selected="selected">
										社会招聘
									</option>
									<option value="校园招聘">
										校园招聘
									</option>
								</select>
								<br>
								性质：
								<select name="nature">
									<option value="全职" selected="selected">
										全职
									</option>
									<option value="兼职">
										兼职
									</option>
								</select>
								<br>
								地点：
								<input style="margin-right: 80px;" type="text" id="adr"
									name="adress" value="" />
								<br>
								薪资：
								<input id="scope" style="margin-right: 80px;" type="text"
									name="scope" value="" />
								<br>
								<br>
								招聘人数：
								<input style="margin-right: 80px;" id="number" type="text"
									name="number" value="" placeholder="请输入数字" />
								<br>
								<br>
								截止时间：
								<input style="margin-right: 80px;" type="text" name="deadtime"
									id="datetimepicker" value="" />
								<br>
								岗位职责
								<input type="text" name="duty" value="" id="duty"
									style="margin-right: 80px; width: 300px; height: 150px;" />
								<br>
								<label>
									任职要求:
								</label>
								<textarea name="content" cols="100" rows="8" id="content"
									style="width: 100%; height: 400px; visibility: hidden;"></textarea>
								<br />
								<input class="btn  btn-info btn-xs info" type="submit" name="button" value="提交内容" "/>
								<a  href="gonggao" class="btn  btn-info btn-xs info" style="width:100px;">返回</a>
							</form>
						</p>
					</div>	
					 <div class="form-group">
					
                  </div><!-- /.form group -->
					
                  </div><!-- /.form group -->
                 
                </div><!-- /.box-body -->
              </div><!-- /.box -->

            </div><!-- /.col (left) -->
          </div><!-- /.row -->
        </section><!-- /.content -->
        <%!
private String htmlspecialchars(String str) {
	str = str.replaceAll("&", "&amp;");
	str = str.replaceAll("<", "&lt;");
	str = str.replaceAll(">", "&gt;");
	str = str.replaceAll("\"", "&quot;");
	return str;
}
%>
<script>

		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[name="content"]', {
				cssPath : '<%=basePath%>common/plugins/code/prettify.css',
				uploadJson : '../upload_json.jsp',
				fileManagerJson : '../file_manager_json.jsp',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						document.forms['example'].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
	<script>
 
	function ischeckNum() {
		var num = document.getElementById('number').value;
		var title = document.getElementById('title').value;
		var adr = document.getElementById('adr').value;
		var scope = document.getElementById('scope').value;
		var time = document.getElementById('datetimepicker').value;
		var duty = document.getElementById('duty').value;
		var content = document.getElementById('content').value;
		
		if (title) {
			
		} else {
			alert('需输入标题');
			document.getElementById("title").focus; 
			return false;
		//	example.number.focus();
		}
		if (adr) {
			
		} else {
			alert('需输入地址');
			document.getElementById("adr").focus; 
		//	example.number.focus();
			return false;
		}
		if (scope) {
			if (isNaN(num)) {
				alert('薪资范围应是数字');
				document.getElementById("scope").focus; 
			//	example.number.select();
				return false;
			} 
		} else {
			alert('需输入薪资范围');
			document.getElementById("scope").focus; 
			return false;
		//	example.number.focus();
		}
		if (num) {
			if (isNaN(num)) {
				alert('招聘人数应是数字');
				document.getElementById("number").focus; 
			//	example.number.select();
				return false;
			} 
		} else {
			alert('需输入招聘人数');
			document.getElementById("number").focus; 
			return false;
		//	example.number.focus();
		}
		if (duty) {
			
		} else {
			alert('需输入职责');
			document.getElementById("duty").focus; 
			return false;
		//	example.number.focus();
		}
		if (content) {
			
		} else {
			alert('需输入要求');
			document.getElementById("content").focus; 
			return false;
		//	example.number.focus();
		}
		if (time) {
			
		} else {
			alert('需输入内容');
			document.getElementById("datetimepicker").focus; 
			return false;
		//	example.number.focus();
		}
	}
</script>